package com.tensquare.recruit.Service;

import com.tensquare.recruit.Dao.EnterpriseDao;
import com.tensquare.recruit.pojo.Enterprise;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import util.IdWorker;

import java.util.List;

@Service
@Transactional
public class EnterpriseService {
    @Autowired
    private EnterpriseDao enterpriseDao;
    @Autowired
    private IdWorker IdWorker;

    @Autowired
    private RedisTemplate redisTemplate;

    public List<Enterprise> hotList(String ishot){
        return enterpriseDao.findByIshot_(ishot);
    }

    public String redisGet(){
        return (String) redisTemplate.opsForValue().get("key1");
    }

    public void redisSet(String s){
        redisTemplate.opsForValue().set("key1","value1");
    }


}
